package com.xbq.exceleditor.db

import android.content.Context
import androidx.room.Room
import com.xbq.xbqsdk.core.db.DatabaseContext

/**
 * Author: liaohaiping
 * Time: 2019-11-28
 * Description:
 */
class DatabaseFactory {
    companion object{
        fun createDatabase(context: Context):ExcelDatabase {
            return Room.databaseBuilder(
                DatabaseContext(context),
                ExcelDatabase::class.java,
                "exceleditor.db"
            )
                .fallbackToDestructiveMigration() //如果需要版本变更的话,删除并重新创建整个数据库
                .build()
        }
    }
}